package com.mcxx.modules.miniSalvation.check.dto;

import lombok.Data;


@Data
public class ResponseDTO {
    private int code;
    private String msg;
    private boolean success;
    public static ResponseDTO successRes(){
        ResponseDTO responseDTO = new ResponseDTO();
        responseDTO.setCode(200);
        responseDTO.setMsg("成功");
        responseDTO.setSuccess(true);
        return responseDTO;
    }
    public static ResponseDTO failRes(){
        ResponseDTO responseDTO = new ResponseDTO();
        responseDTO.setCode(400);
        responseDTO.setMsg("处理失败");
        responseDTO.setSuccess(false);
        return responseDTO;
    }
    public static ResponseDTO failRes(String errorMsg){
        ResponseDTO responseDTO = new ResponseDTO();
        responseDTO.setCode(400);
        responseDTO.setMsg(errorMsg);
        responseDTO.setSuccess(false);
        return responseDTO;
    }
    public static ResponseDTO failRes(int code,String errorMsg){
        ResponseDTO responseDTO = new ResponseDTO();
        responseDTO.setCode(code);
        responseDTO.setMsg(errorMsg);
        responseDTO.setSuccess(false);
        return responseDTO;
    }
}
